package Processes;

import threadedSimulator.Cpu;
/**
 * a mouse process that spawns on mouse events.
 * @author Harris
 */
public class MouseProcess extends Processes{

    /**
     * constructor
     * @param the_cpu the cpu
     * @param the_numberof_pro_con the number of producers and consumers
     */
    public MouseProcess(Cpu the_cpu, String the_numberof_pro_con) {
	super(the_cpu, the_numberof_pro_con, "Mouse");
	my_priority = 1;
    }

    /**
     * runs the process and adds the number with the number squared.
     */
    @Override
    public void run() {
        double temp = 0;
        while (running && my_current_index <= MAX_VALUE) {
            running = true;
            
            temp += Math.pow(temp, 2);
            
            my_current_index++;
            if (my_current_index == MAX_VALUE) { //restarts the loop
                my_current_index = 0;
                temp = 0;
                running = false;
            }	
            
        }
    }

	

}
